<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/11/4
 * Time: 17:33
 */

namespace Modules\Admin\Http\Controllers;

use HiCommon\Repository\ShopModifyRepository;
use Illuminate\Support\Facades\Request;
use Modules\Admin\Service\ShopServerTypeServer;

class ShopServerTypeController extends BaseController
{

    public function index()
    {
        $arr_search = (array)Request::all();
        $arr_list = ShopServerTypeServer::get_list((array)$arr_search);
        echo_error($arr_list);
        return view('admin::shopServerType.index', $arr_list['data']);
    }


    /**
     *  添加视图
     *  hinq 2019 11 05
     *
     **/
    public function create()
    {
        $arr_search = (array) Request::all();
        return view('admin::shopServerType.create', ['arr_search' => $arr_search ]);
    }


    /**
     *  添加服务类型数据
     *  hinq 2019 11 05
     *
     **/
    public function store()
    {
        $arr_input = (array)Request::all();
        return ShopServerTypeServer::add_one((array)$arr_input);
    }


    /**
     *  编辑视图
     *  hinq 2019 11 05
     *
     **/
    public function edit()
    {
        $nId = (int)Request::get('id');
        $info = ShopServerTypeServer::get_one((int)$nId);
        return view('admin::shopServerType.edit', ['info' => $info]);
    }

    /**
     *  编辑数据
     *  hinq 2019 11 05
     *
     **/
    public function update()
    {
        $arr_input = (array)Request::all();
        return ShopServerTypeServer::edit_one((array)$arr_input);
    }


    /**
     *  删除数据
     *  hinq 2019 11 05
     *
     **/
    public function delete()
    {
        $nId = (int)Request::get('id');
        return ShopServerTypeServer::delete((int)$nId);
    }


}